#include "NumberBoatPageWizard.h"

NumberBoatPageWizard :: NumberBoatPageWizard(int _nMin, int _nMax, const char* name, QWidget* parent) : QWizardPage(parent), nMin(_nMin), nMax(_nMax) {
	QString title(GETNUMBERBOAT);
	title.append(" ");
	title.append(name);
	setTitle(title);
	QLabel* textNumberBoat = new QLabel(title);
	dimGetter = new QSpinBox();
	dimGetter->setRange(nMin, nMax);
	dimGetter->setSingleStep(1);
	dimGetter->setValue(nMin);
	connect(dimGetter, SIGNAL(valueChanged(int)), this, SLOT(valueChangedGetter(int)));
	textNumberBoat->setWordWrap(true);
	QVBoxLayout *numberBoatLayout = new QVBoxLayout;
	numberBoatLayout->addWidget(textNumberBoat);
	numberBoatLayout->addWidget(dimGetter);
	setLayout(numberBoatLayout);
}

void NumberBoatPageWizard :: setMaxNumber(int _nMax) {
	nMax = 3*_nMax/15;
	dimGetter->setRange(nMin, nMax);
}


void NumberBoatPageWizard :: valueChangedGetter(int num) {
	emit valueChanged(num);
}
